// 服务器全部接口相同返回的数据类型
export interface ResponseData {
    code: number,
    message: string,
    ok: boolean
}

// 一个账号对象的ts类型
export interface User {
    id?: number,
    createTime?: string,
    updateTime?: string,
    username: string,
    password: string,
    name: string,
    phone?: null | string,
    roleName?: string
}

// 数组包含全部用户信息
export type Records = User[]

// 全部接口返回数据类型
export interface UserResponseData extends ResponseData {
    data: {
        records: Records,
        total: number,
        size: number,
        current: number,
        pages: number
    }
}


// 一个职位的对象ts类型
export interface RoleData {
    id: number,
    createTime: string,
    updateTime: string,
    roleName: string,
    remark: null
}

// 全部职位的数组
export type AllRole = RoleData[]

// 接口返回数据类型
export interface AllRoleResponseData extends ResponseData {
    data: {
        assignRoles: AllRole,
        allRolesList: AllRole
    }
}


// 给已有的用户分配角色接口携带参数ts类型
export interface SetRoleData {
    roleIdList: number[],
    userId: number
}